{  Statement: http://acmp.ru/?main=task&id_task=44
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    ans,kk,tt:longint;
    s:string;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(s);
kk := pos('>>-->',s);
tt := pos('<--<<',s);
ans := 0;
while kk + tt > 0 do begin
    inc(ans);
    if ((kk > 0) and (kk < tt)) or (tt = 0) then delete(s,1,kk) else delete(s,1,tt);    
    kk := pos('>>-->',s);
    tt := pos('<--<<',s);
end;
write(ans);
end.